<template>
  <div class="mask-layer" @click="clickMask" :style="`background-color:rgba(0,0,0,${alpha})`">
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: 'mask-layer',
  props: {
    // 透明度
    alpha: {
      type: Number,
      default: 0.9,
    }
  },
  methods: {
    clickMask () {
      this.$emit('clickMask')
    }
  },
}
</script>

<style scoped>
.mask-layer {
  position: fixed;
  width: 100vw;
  height: 100vh;
}
</style>